import request from '@/utils/request'

//获取菜单树
export function getMenuTree(data) {
	return request({
		method: 'get',
		url: 'tbSysMenu/queryList',
		headers: {
			userButton: '6d8e442ba5534977a571f88317845389'
		},
		params: data,
	})
}

//添加菜单
export function addedMenu(data) {
	return request({
		method: 'post',
		url: 'tbSysMenu/add',
		headers: {
			userButton: '85b7a219df564aeb99248de8aa5cbd65'
		},
		data,
	})
}

//删除菜单
export function deleteMenu(id) {
	return request({
		method: 'get',
		url: 'tbSysMenu/delete/' + id,
		headers: {
			userButton: '004590f639254d45936e9ad0e00d3bf1'
		},
	})
}

//修改菜单
export function updateMenu(data) {
	return request({
		method: 'post',
		url: 'tbSysMenu/update',
		headers: {
			userButton: '75a88a9cc81b48f2aa4d40a6320f6ea8'
		},
		data,
	})
}

//获取菜单数据 - 登录成功以后展示，返回菜单和按钮数据
export function queryPermissionMenu() {
	return request({
		method: 'get',
		url: 'tbSysMenu/queryHomeData',
		headers: {
			userButton: '6dbe37be3dd1476d8f45c50c062cbb4f'
		}
	})
}

//获取菜单数据 - 角色菜单授权页面
export function queryGrantMenu(roleId) {
	return request({
		method: 'get',
		url: 'tbSysMenu/tree/' + roleId,
		headers: {
			userButton: '43ee689266f74b3297092b353b1094ef'
		}
	})
}